package org.cloud.im.server.protocol;

import org.cloud.im.core.exception.ImException;
import org.cloud.im.core.protocol.AbstractProtocol;
import org.cloud.im.server.config.ImServerConfig;

/**
 * @Author: w.weidong.lin@abite.com
 * @Description: 抽象协议处理器
 * @Date: create in 2021/10/19 18:03
 */
public abstract class AbstractProtocolHandler implements IProtocolHandler {

    protected AbstractProtocol protocol;

    public AbstractProtocolHandler(){};

    public AbstractProtocolHandler(AbstractProtocol protocol){
        this.protocol = protocol;
    }

    /**
     * 初始化不同协议
     * @param imServerConfig
     * @throws ImException
     */
    public abstract void init(ImServerConfig imServerConfig)throws ImException;

    public AbstractProtocol getProtocol() {
        return protocol;
    }
}
